<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>startsWith方法和endsWith方法</title>
</head>

<body>
	<script type="text/javascript">
		// let str = 'Hello ECMAScript 2015';
		// let r1 = str.startsWith('Hello');
		// console.log(r1);
		// let r2 = str.endsWith('2016');
		// console.log(r2)

		let str = '我爱中国,中国爱我,学IT就来黑马程序员'
		console.log(str.startsWith('我爱'))
		console.log(str.startsWith('你爱'))
		console.log(str.endsWith('程序员'))
		console.log(str.endsWith('程序猿'))
	</script>
</body>

</html>